<?php
require_model('base.class');
class DoctorAccountTransaction extends base {
    private $table = 'DoctorAccountTransaction';
    private $primary = 'TransactionId';
    function __construct() {
        parent::__construct($this->table,$this->primary);
    }
    function AddDepositTransaction($params) {
        return $this->insert_item($params);
    }
    function AddWithdrawalTransaction($params) {
        return $this->insert_item($params);
    }
    function GetTransactionByDoctorUserName($username,$page=false, array & $request) {
        if($page) {
            $obj = $this->db->create_mapper($this->table)->where(array('UserName'=>$username));
            return load_model('page')->list_page($obj, $request);
        }else {
            return $this->get_items(array('UserName'=>$username));
        }
    }
    function GetTransactionByRegistrationId($registrationId, $page=false, array & $request){
        if($page) {
            $obj = $this->db->create_mapper($this->table)->where(array('RegistrationId'=>$registrationId));
            return load_model('page')->list_page($obj, $request);
        }else {
            return $this->get_items(array('RegistrationId'=>$registrationId));
        }
    }
    function GetTransactionByDoctorUserNameAndType($username, $type) {

    }
}